package com.rmt.www.action;

import java.util.ArrayList;
import java.util.List;
import com.opensymphony.xwork2.ActionSupport;
import com.rmt.www.dao.ProjectDao;
import com.rmt.www.dao.UserDao;
import com.rmt.www.service.AdminManageProjectService;
import com.rmt.www.vo.Project;
import com.rmt.www.vo.User;


public class DeleteProjectAction extends ActionSupport{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private List<String> pid;
	public AdminManageProjectService getAdminManageProjectService() {
		return adminManageProjectService;
	}


	public void setAdminManageProjectService(
			AdminManageProjectService adminManageProjectService) {
		this.adminManageProjectService = adminManageProjectService;
	}

	private AdminManageProjectService adminManageProjectService;
	

	public List<String> getPid() {
		return pid;
	}


	public void setPid(List<String> pid) {
		this.pid = pid;
	}

	public void deleteProject(){
		int id;
		String tmp;
		List<Integer> idList = new ArrayList<Integer>();
		for(int i=0;i<pid.size();i++){
			tmp=pid.get(i).trim();
		 	id=Integer.parseInt(tmp);
		 	idList.add(id);
		}
		adminManageProjectService.deleteProjectsByIdList(idList);
	}
	/*
	public String execute(){
		int id;
		for(int i=0;i<pid.size();i++){
			id=Integer.parseInt(pid.get(i));
			projectDao.deleteProject(id);
		}
		return "success";
	}
	*/
}
